<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\modules\tool\models\DataBaseBack */
/* @var $form yii\widgets\ActiveForm */
function get_config(){
    $data=\backend\modules\tool\models\SqlConfig::find()
        ->select(new \yii\db\Expression("id,source_name"))
        ->asArray()
        ->all();
    $data=\backend\modules\tool\helpers\ArrayHelper::array_parse_key_value($data,"id","source_name");
    return $data;
}
?>

<div class="DataBaseBack-form">

    <?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id')->hiddenInput()->label(false) ?>
             <?= $form->field($model, 'source_database')->dropDownList(get_config()) ?>
<!--            --><?//= $form->field($model, 'last_run')->textInput(['maxlength' => true]) ?>
            <?= $form->field($model, 'node_name')->textInput(['maxlength' => true]) ?>
            
    <div class="form-group">
        <?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
    </div>
    <?php ActiveForm::end(); ?>

</div>
